package com.alipay.app.groupmeal.standard.widget.business;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.alipay.app.groupmeal.standard.R;
import com.alipay.app.groupmeal.standard.constant.ConfigConstant;

/**
 * @ProjectName: 团餐
 * @ClassName: Sn
 * @Description: java类作用描述
 * @Author: bd-001935
 * @CreateDate: 4/19/22 11:45 AM
 * @UpdateUser: bd-001935
 * @UpdateDate: 4/19/22 11:45 AM
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class BottomSnView extends BaseBScreenView {

    private TextView mTvApply;
    private boolean showApply;

    public BottomSnView(Context context) {
        this(context, null);
    }

    public BottomSnView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BottomSnView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setFocusable(false);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.view_bottom_sn;
    }

    @Override
    protected void initView(View view) {
        mTvApply = view.findViewById(R.id.tv_apply);
    }

    @Override
    public int[] getStyleableRes() {
        return R.styleable.BSSnView;
    }

    @Override
    public void getAttrs(TypedArray ta) {
        super.getAttrs(ta);
        showApply = ta.getBoolean(R.styleable.BSSnView_showApply, true);
    }

    @Override
    protected void initData() {
        if (showApply) {
            mTvApply.setVisibility(VISIBLE);
            mTvApply.setText(ConfigConstant.isvName + "服务商\n提供技术支持");
        } else
            mTvApply.setVisibility(GONE);
    }

}
